<!DOCTYPE html>


<html lang="zh-CN">


<head>
  <meta charset="utf-8" />
  <meta name="baidu-site-verification" content="code-kg5UjKJZM2" />
   
  <meta name="keywords" content="活,炼" />
   
  <meta name="description" content="shimmerjordan" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <title>
    Introduction to Machine Learning Algorithms |  丛烨-shimmerjordan
  </title>
  <meta name="generator" content="hexo-theme-ayer">
  
  <link rel="shortcut icon" href="/favicon.ico" />
  
  
<link rel="stylesheet" href="/dist/main.css">

  <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/css/remixicon.min.css">
  
<link rel="stylesheet" href="/css/custom.css">

  
  <script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>
  
  

<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'G-Q0DT8B8VJW', 'auto');
ga('send', 'pageview');

</script>



  
<script>
var _hmt = _hmt || [];
(function() {
	var hm = document.createElement("script");
	hm.src = "https://hm.baidu.com/hm.js?6d06f826e125297d4ce0fa7a1449328e";
	var s = document.getElementsByTagName("script")[0]; 
	s.parentNode.insertBefore(hm, s);
})();
</script>


<link rel="alternate" href="/atom.xml" title="丛烨-shimmerjordan" type="application/atom+xml">
</head>

</html>

	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css">
	<script src="https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/autoload.js"></script>


<body>
  <div id="app">
    
      
    <main class="content on">
      <section class="outer">
  <article
  id="post-Introduction to machine learning algorithms"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h1 class="article-title sea-center" style="border-left:0" itemprop="name">
  Introduction to Machine Learning Algorithms
</h1>
 

    </header>
     
    <div class="article-meta">
      <a href="/2020/11/04/MLAIntro/" class="article-date">
  <time datetime="2020-11-04T10:36:11.000Z" itemprop="datePublished">2020-11-04</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/Machine-Learning/">Machine Learning</a>
  </div>
  
<div class="word_count">
    <span class="post-time">
        <span class="post-meta-item-icon">
            <i class="ri-quill-pen-line"></i>
            <span class="post-meta-item-text"> 字数统计:</span>
            <span class="post-count">1.3k</span>
        </span>
    </span>

    <span class="post-time">
        &nbsp; | &nbsp;
        <span class="post-meta-item-icon">
            <i class="ri-book-open-line"></i>
            <span class="post-meta-item-text"> 阅读时长≈</span>
            <span class="post-count">8 分钟</span>
        </span>
    </span>
</div>
 
    </div>
      
    <div class="tocbot"></div>




  
    <div class="article-entry" itemprop="articleBody">
       
  <p>There are too many algorithms involved in artificial intelligence, and there are quite a few used in machine learning, so how can we choose the right algorithm?</p>
<p>This blog provides a brief introduction to machine learning algorithms, with specific descriptions and notes to be added later. </p>
<span id="more"></span>
<h2 id="Introduction"><a href="#Introduction" class="headerlink" title="Introduction"></a>Introduction</h2><p>There are too many algorithms involved in artificial intelligence, and there are quite a few used in machine learning, so how can we choose the right algorithm?</p>
<p>That is the question. In the following, I will take you through what algorithms are available and how to choose one.</p>
<p>The outline of this Part</p>
<ol>
<li><p>Classification from the perspective of machine learning problems</p>
</li>
<li><p>Classification from the functional perspective of the algorithm</p>
</li>
<li><p>Machine learning algorithm decision tree</p>
</li>
</ol>
<h2 id="Classification-from-the-perspective-of-machine-learning-problems"><a href="#Classification-from-the-perspective-of-machine-learning-problems" class="headerlink" title="Classification from the perspective of machine learning problems"></a>Classification from the perspective of machine learning problems</h2><p>We start by classifying the machine learning problem itself in terms of the following types of algorithms.</p>
<h3 id="Supervised-learning"><a href="#Supervised-learning" class="headerlink" title="Supervised learning"></a>Supervised learning</h3><p>A large part of the problem in machine learning falls under the category of supervised learning, which, to put it simply and colloquially, is that given a training sample in which each sample input x corresponds to a deterministic outcome y, we need to train a model (mathematically, an x → y mapping f) that allows us to make predictions about the outcome y′ given an unknown sample x′.</p>
<p>If the prediction result is a discrete value (often a category type, such as spam/general mail in the mail classification problem, such as users will/won’t buy a product), then we call it a classification problem; if the prediction result is a continuous value (such as house price, stock price, etc.), then we call it a regression problem.</p>
<p>There are a range of machine learning algorithms that are used to solve supervised learning problems, such as the most classical ones for classification problems such as plain Bayes, logistic regression, support vector machines, etc.; for example, linear regression for regression problems and so on.</p>
<h3 id="Semi-supervised-learning"><a href="#Semi-supervised-learning" class="headerlink" title="Semi-supervised learning"></a>Semi-supervised learning</h3><p>This type of problem gives training data that is partly labeled and partly unlabeled. We want to learn the organizational structure of the data and also make predictions accordingly. The corresponding machine learning algorithms for such problems are Self-Training, Transductive Learning, Generative Model, and so on.</p>
<p>In general, the most common are the first two types of problems, and some machine learning algorithms corresponding to the first two types of problems are as follows.</p>
<p><img src="https://s1.ax1x.com/2020/11/04/BgHB7D.png" alt="BgHB7D.png"></p>
<h2 id="Classifying-algorithms-in-terms-of-their-functionality"><a href="#Classifying-algorithms-in-terms-of-their-functionality" class="headerlink" title="Classifying algorithms in terms of their functionality"></a>Classifying algorithms in terms of their functionality</h2><p>We can classify machine learning algorithms in terms of their common features (E.g., function, mode of operation). In the following, we’ll go ahead and classify algorithms based on their commonality. It should be noted, however, that our following categorization method may have a strong bias towards classification and regression, which are the most commonly encountered problems.</p>
<h3 id="Regression-Algorithms"><a href="#Regression-Algorithms" class="headerlink" title="Regression Algorithms"></a>Regression Algorithms</h3><p><img src="https://s1.ax1x.com/2020/11/05/B23Sd1.png" alt="B23Sd1.png"></p>
<p>A regression algorithm is a class of algorithms that obtains the best way to combine the input features by minimizing the difference between the predicted value and the actual result value. For continuous value prediction, there is linear regression, etc. For discrete value/category prediction, we can also consider logistic regression as a type of regression algorithm:</p>
<ul>
<li>Ordinary Least Squares Regression(OLSR)</li>
<li>Linear Regression</li>
<li>Logistic Regression</li>
<li>Stepwise Regression</li>
<li>Locally Estimated Scatterplot Smoothing(LOESS)</li>
<li>Multivariate Adaptive Regression Splines(MARS)</li>
</ul>
<h3 id="Instance-based-Algorithms"><a href="#Instance-based-Algorithms" class="headerlink" title="Instance-based Algorithms"></a>Instance-based Algorithms</h3><p><img src="https://s1.ax1x.com/2020/11/05/B235lD.png" alt="B235lD.png"></p>
<p>By instance-based algorithms here, I mean the model we finally build that still has a strong dependence on the original data sample instance. These types of algorithms, when making predictive decisions, typically use some type of similarity criterion to compare the similarity of the sample to be predicted to the original sample, and then give the corresponding prediction. Common example-based algorithms include:</p>
<ul>
<li>k-Nearest Neighbour (kNN)</li>
<li>Learning Vector Quantization (LVQ)</li>
<li>Self-Organizing Map (SOM)</li>
<li>Locally Weighted Learning (LWL)</li>
</ul>
<h3 id="Decision-Tree-Algorithms"><a href="#Decision-Tree-Algorithms" class="headerlink" title="Decision Tree Algorithms"></a>Decision Tree Algorithms</h3><p><img src="https://s1.ax1x.com/2020/11/05/B23x1S.png" alt="B23x1S.png"></p>
<p>A decision tree class algorithm will build a tree containing many decision paths based on the raw data features. The prediction phase selects the paths for decision making. Common decision tree algorithms include:</p>
<ul>
<li>Classification and Regression Tree (CART)</li>
<li>Iterative Dichotomiser 3 (ID3)</li>
<li>C4.5 and C5.0 (different versions of a powerful approach)</li>
<li>Chi-squared Automatic Interaction Detection (CHAID)</li>
<li>M5</li>
<li>Conditional Decision Trees</li>
</ul>
<h3 id="Bayesian-Algorithms"><a href="#Bayesian-Algorithms" class="headerlink" title="Bayesian Algorithms"></a>Bayesian Algorithms</h3><p><img src="https://s1.ax1x.com/2020/11/05/B28LDJ.png" alt="B28LDJ.png"></p>
<p>Bayesian-like algorithms are referred to here as algorithms that implicitly use Bayesian principles in classification and regression problems. Including.</p>
<ul>
<li>Naive Bayes</li>
<li>Gaussian Naive Bayes</li>
<li>Multinomial Naive Bayes</li>
<li>Averaged One-Dependence Estimators (AODE)</li>
<li>Bayesian Belief Network (BBN)</li>
<li>Bayesian Network (BN)</li>
</ul>
<h3 id="Clustering-Algorithms"><a href="#Clustering-Algorithms" class="headerlink" title="Clustering Algorithms"></a>Clustering Algorithms</h3><p><img src="https://s1.ax1x.com/2020/11/05/B2GEVA.png" alt="B2GEVA.png"></p>
<p>What clustering algorithms do is to cluster the input samples into ‘clusters’ of ‘data’ around some center in order to discover some patterns in the structure of the data distribution. Commonly used clustering algorithms include.</p>
<ul>
<li>k-Means</li>
<li>Hierarchical Clustering</li>
<li>Expectation Maximisation (EM)</li>
</ul>
<h3 id="Association-Rule-Learning-Algorithms"><a href="#Association-Rule-Learning-Algorithms" class="headerlink" title="Association Rule Learning Algorithms"></a>Association Rule Learning Algorithms</h3><p><img src="https://s1.ax1x.com/2020/11/05/B2GRxO.png" alt="B2GRxO.png"></p>
<p>Association rule algorithms are a class of algorithms that attempt to extract, the rules that best explain the observed correlations between training samples, i.e., to gain knowledge of dependencies or associations between an event and other events, common association rule algorithms are.</p>
<ul>
<li>Apriori algorithm</li>
<li>Eclat algorithm</li>
</ul>
<h3 id="Artificial-Neural-Network-Algorithms"><a href="#Artificial-Neural-Network-Algorithms" class="headerlink" title="Artificial Neural Network Algorithms"></a>Artificial Neural Network Algorithms</h3><p><img src="https://s1.ax1x.com/2020/11/05/B2JeeJ.png" alt="B2JeeJ.png"></p>
<p>This is a class of algorithms inspired by the way neurons work in the human brain. It is important to mention that I have singled out “deep learning”, and that the artificial neural network in this case favours more traditional perception algorithms, which include.</p>
<ul>
<li>Perceptron</li>
<li>Back-Propagation</li>
<li>Radial Basis Function Network (RBFN)</li>
</ul>
<h3 id="Deep-Learning-Algorithms"><a href="#Deep-Learning-Algorithms" class="headerlink" title="Deep Learning Algorithms"></a>Deep Learning Algorithms</h3><p><img src="https://s1.ax1x.com/2020/11/05/B2JMJx.png" alt="B2JMJx.png"></p>
<p>Deep learning is a very hot field of machine learning in recent years, and it usually has a deeper level and more complex structure compared to the artificial neural network algorithms listed above. This type of algorithm is widely used in computer vision.</p>
<ul>
<li>Deep Boltzmann Machine (DBM)</li>
<li>Deep Belief Networks (DBN)</li>
<li>Convolutional Neural Network (CNN)</li>
<li>Stacked Auto-Encoders</li>
</ul>
<h3 id="Dimensionality-Reduction-Algorithms"><a href="#Dimensionality-Reduction-Algorithms" class="headerlink" title="Dimensionality Reduction Algorithms"></a>Dimensionality Reduction Algorithms</h3><p><img src="https://s1.ax1x.com/2020/11/05/B2JGOe.png" alt="B2JGOe.png"></p>
<p>In a way, dimensionality reduction algorithms are actually somewhat similar to clustering in that they are also attempting to discover the inherent structure of the original training data, but the dimensionality reduction algorithm is attempting, with less information (lower dimensional information) to summarize and describe much of the original information.</p>
<p>Interestingly, dimensionality reduction algorithms are generally useful in visualizing data, or in reducing the computational space of data. It is used as a machine learning algorithm, and many times it is used to process the data first and then imbibe other machine learning algorithms to learn. The main dimensionality reduction algorithms include.</p>
<ul>
<li>Principal Component Analysis (PCA)</li>
<li>Principal Component Regression (PCR)</li>
<li>Partial Least Squares Regression (PLSR)</li>
<li>Sammon Mapping</li>
<li>Multidimensional Scaling (MDS)</li>
<li>Linear Discriminant Analysis (LDA)</li>
<li>Mixture Discriminant Analysis (MDA)</li>
<li>Quadratic Discriminant Analysis (QDA)</li>
<li>Flexible Discriminant Analysis (FDA)</li>
</ul>
<h3 id="Ensemble-Algorithms"><a href="#Ensemble-Algorithms" class="headerlink" title="Ensemble Algorithms"></a>Ensemble Algorithms</h3><p><img src="https://s1.ax1x.com/2020/11/05/B2JwfP.png" alt="B2JwfP.png"></p>
<p>Strictly speaking, it’s not really a machine learning algorithm, but more of an optimization tool/strategy that usually combines multiple simple weak machine learning algorithms to make more reliable decisions. Take the classification problem, for example, it is intuitively understood that a single classifier can be wrong and unreliable, but if multiple classifiers vote, then it is much more reliable. Common approaches to model fusion enhancement include.</p>
<ul>
<li>Random Forest</li>
<li>Boosting</li>
<li>Bootstrapped Aggregation (Bagging)</li>
<li>AdaBoost</li>
<li>Stacked Generalization (blending)</li>
<li>Gradient Boosting Machines (GBM)</li>
<li>Gradient Boosted Regression Trees (GBRT)</li>
</ul>
<h2 id="Decision-trees-for-machine-learning-algorithms"><a href="#Decision-trees-for-machine-learning-algorithms" class="headerlink" title="Decision trees for machine learning algorithms"></a>Decision trees for machine learning algorithms</h2><p><img src="https://s1.ax1x.com/2020/11/05/B2Jff0.png" alt="B2Jff0.png"></p>
<p>First of all, if the sample size is very small, there is no way for all machine learning algorithms to “learn” common rules and patterns from it, so getting more data is king. Then according to the problem is unsupervised learning and continuous/discrete value prediction, it is divided into four method classes: classification, clustering, regression and dimensional reduction, and each class has a different treatment according to the specific situation.</p>
<p>With this decision tree, it is easy to choose the right algorithm based on the data you have and the purpose you want to achieve.</p>
<p>And this image is from <a target="_blank" rel="noopener" href="https://scikit-learn.org/stable/tutorial/machine_learning_map/">https://scikit-learn.org/stable/tutorial/machine_learning_map/</a></p>
<h2 id="Related-work"><a href="#Related-work" class="headerlink" title="Related work"></a>Related work</h2><p>The October 2014 issue of JMLR has a fabulous article, Do we Need Hundreds of Classifiers to Solve Real World Classification Problems? testing the performance of 179 classification models on 121 data from all of UCI. Random Forests and SVM (Gaussian kernel, with LibSVM version) were found to perform best.<a target="_blank" rel="noopener" href="https://jmlr.org/papers/v15/delgado14a.html">Do we Need Hundreds of Classifiers to Solve Real World Classification Problems?</a></p>
 
      <!-- reward -->
      
      <div id="reword-out">
        <div id="reward-btn">
          打赏
        </div>
      </div>
      
    </div>
    

    <!-- copyright -->
    
    <div class="declare">
      <ul class="post-copyright">
        <li>
          <i class="ri-copyright-line"></i>
          <strong>版权声明： </strong>
          
          本博客所有文章除特别声明外，著作权归作者所有。转载请注明出处！
          
        </li>
      </ul>
    </div>
    
    <footer class="article-footer">
       
<div class="share-btn">
      <span class="share-sns share-outer">
        <i class="ri-share-forward-line"></i>
        分享
      </span>
      <div class="share-wrap">
        <i class="arrow"></i>
        <div class="share-icons">
          
          <a class="weibo share-sns" href="javascript:;" data-type="weibo">
            <i class="ri-weibo-fill"></i>
          </a>
          <a class="weixin share-sns wxFab" href="javascript:;" data-type="weixin">
            <i class="ri-wechat-fill"></i>
          </a>
          <a class="qq share-sns" href="javascript:;" data-type="qq">
            <i class="ri-qq-fill"></i>
          </a>
          <a class="douban share-sns" href="javascript:;" data-type="douban">
            <i class="ri-douban-line"></i>
          </a>
          <!-- <a class="qzone share-sns" href="javascript:;" data-type="qzone">
            <i class="icon icon-qzone"></i>
          </a> -->
          
          <a class="facebook share-sns" href="javascript:;" data-type="facebook">
            <i class="ri-facebook-circle-fill"></i>
          </a>
          <a class="twitter share-sns" href="javascript:;" data-type="twitter">
            <i class="ri-twitter-fill"></i>
          </a>
          <a class="google share-sns" href="javascript:;" data-type="google">
            <i class="ri-google-fill"></i>
          </a>
        </div>
      </div>
</div>

<div class="wx-share-modal">
    <a class="modal-close" href="javascript:;"><i class="ri-close-circle-line"></i></a>
    <p>扫一扫，分享到微信</p>
    <div class="wx-qrcode">
      <img src="//api.qrserver.com/v1/create-qr-code/?size=150x150&data=https://blog.shimmerjordan.eu.org/2020/11/04/MLAIntro/" alt="微信分享二维码">
    </div>
</div>

<div id="share-mask"></div>  
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Algorithms/" rel="tag">Algorithms</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Machine-Learning/" rel="tag">Machine Learning</a></li></ul>

    </footer>
  </div>

   
  <nav class="article-nav">
    
      <a href="/2020/11/06/MLAComparison/" class="article-nav-link">
        <strong class="article-nav-caption">上一篇</strong>
        <div class="article-nav-title">
          
            Comparison between Machine Learning Algorithms
          
        </div>
      </a>
    
    
      <a href="/2020/11/03/Milestones/" class="article-nav-link">
        <strong class="article-nav-caption">下一篇</strong>
        <div class="article-nav-title">Milestones</div>
      </a>
    
  </nav>

   
<!-- valine评论 -->
<div id="vcomments-box">
  <div id="vcomments"></div>
</div>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/valine@1.4.14/dist/Valine.min.js"></script>
<script>
  new Valine({
    el: "#vcomments",
    app_id: "StYfTMDp78X0EltFR16ve2q5-gzGzoHsz",
    app_key: "G4RPxRpXG6RwdfpnJefOSnyy",
    path: window.location.pathname,
    avatar: "wavatar",
    placeholder: "ヾﾉ≧∀≦)o来啊，快活啊!",
    recordIP: true,
  });
  const infoEle = document.querySelector("#vcomments .info");
  if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) {
    infoEle.childNodes.forEach(function (item) {
      item.parentNode.removeChild(item);
    });
  }
</script>
<style>
  #vcomments-box {
    padding: 5px 30px;
  }

  @media screen and (max-width: 800px) {
    #vcomments-box {
      padding: 5px 0px;
    }
  }

  #vcomments-box #vcomments {
    background-color: #fff;
  }

  .v .vlist .vcard .vh {
    padding-right: 20px;
  }

  .v .vlist .vcard {
    padding-left: 10px;
  }
</style>

 
   
   
<!-- minivaline评论 -->
<div id="mvcomments-box">
  <div id="mvcomments"></div>
</div>
<script src="https://cdn.jsdelivr.net/npm/minivaline@latest"></script>
<script>
    new MiniValine(Object.assign({"enable":true,"mode":"DesertsP","placeholder":"Write a Comment","math":true,"md":true,"enableQQ":true,"NoRecordIP":false,"visitor":true,"maxNest":6,"pageSize":6,"adminEmailMd5":"de8a7aa53d07e6b6bceb45c64027763d","tagMeta":["管理员","小伙伴","访客"],"master":["de8a7aa53d07e6b6bceb45c64027763d"],"friends":["b5bd5d836c7a0091aa8473e79ed4c25e","adb7d1cd192658a55c0ad22a3309cecf","3ce1e6c77b4910f1871106cb30dc62b0","cfce8dc43725cc14ffcd9fb4892d5bfc"],"lang":null,"emoticonUrl":["https://cdn.jsdelivr.net/npm/alus@latest","https://cdn.jsdelivr.net/gh/MiniValine/qq@latest","https://cdn.jsdelivr.net/gh/MiniValine/Bilibilis@latest","https://cdn.jsdelivr.net/gh/MiniValine/tieba@latest","https://cdn.jsdelivr.net/gh/MiniValine/twemoji@latest","https://cdn.jsdelivr.net/gh/MiniValine/weibo@latest"]}, {
	  el: '#mvcomments',
    }));
  const infoEle = document.querySelector('#mvcomments .info');
  if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) {
      infoEle.childNodes.forEach(function (item) {
          item.parentNode.removeChild(item);
      });
  }
</script>
<style>
	#mvcomments-box {
		padding: 5px 30px;
	}
	@media screen and (max-width: 800px) {
		#mvcomments-box {
		  padding: 5px 0px;
		}
	}
	.darkmode .MiniValine *{
		color: #f1f1f1!important;
	}
	.darkmode .commentTrigger{
		background-color: #403e3e !important;
	  }
	.darkmode .MiniValine .vpage .more{
		background: #21232F
	}
	.darkmode img{
		filter: brightness(30%)
	}
	.darkmode .MiniValine .vlist .vcard .vcomment-body .text-wrapper .vcomment.expand:before{
		background: linear-gradient(180deg, rgba(246,246,246,0), rgba(0,0,0,0.9))
	}
	.darkmode .MiniValine .vlist .vcard .vcomment-body .text-wrapper .vcomment.expand:after{
		background: rgba(0,0,0,0.9)
	}
	.darkmode .MiniValine .vlist .vcard .vcomment-body .text-wrapper .vcomment pre{
		background: #282c34
		border: 1px solid #282c34
	}
	.darkmode .MiniValine .vinputs-area .textarea-wrapper textarea{
		color: #000;
	}
	.darkmode .MiniValine .vinputs-area .auth-section .input-wrapper input{
		color: #000;
	}
	.darkmode .MiniValine .vinputs-area .vextra-area .vsmile-icons{
		background: transparent;
	}
	.darkmode .MiniValine .vinputs-wrap{
		border-color: #b2b2b5;
	}
	.darkmode .MiniValine .vinputs-wrap:hover{
		border: 1px dashed #2196f3;
	}
	.darkmode .MiniValine .vinputs-area .auth-section .input-wrapper{
		border-bottom: 1px dashed #b2b2b5;
	}
	.darkmode .MiniValine .vinputs-area .auth-section .input-wrapper:hover{
		border-bottom: 1px dashed #2196f3;
	}
	.darkmode .MiniValine .vbtn{
		background-color: transparent!important;
	}
	.darkmode .MiniValine .vbtn:hover{
		border: 1px dashed #2196f3;
	}
</style>

    
</article>

</section>
      <footer class="footer">
  <div class="outer">
    <ul>
      <li>
        Copyrights &copy;
        2019-2024
        <i class="ri-heart-fill heart_icon"></i> 鞠桥丹-QIAODAN JU
      </li>
    </ul>
    <ul>
      <li>
        
        
        
        由 <a href="https://hexo.io" target="_blank">Hexo</a> 强力驱动
        <span class="division">|</span>
        主题 - <a href="https://github.com/Shen-Yu/hexo-theme-ayer" target="_blank">Ayer</a>
        
      </li>
    </ul>
    <ul>
      <li>
        
        
        <span>
  <span><i class="ri-user-3-fill"></i>访问人数:<span id="busuanzi_value_site_uv"></span></s>
  <span class="division">|</span>
  <span><i class="ri-eye-fill"></i>浏览次数:<span id="busuanzi_value_page_pv"></span></span>
</span>
        
      </li>
    </ul>
    <ul>
      
    </ul>
    <ul>
      
    </ul>
    <ul>
      <li>
        <!-- cnzz统计 -->
        
        <script type="text/javascript" src='https://s4.cnzz.com/z_stat.php?id=1279035150&amp;web_id=1279035150'></script>
        
      </li>
    </ul>
  </div>
</footer>
      <div class="float_btns">
        <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>

<div class="todark" id="todark">
  <i class="ri-moon-line"></i>
</div>

      </div>
    </main>
    <aside class="sidebar on">
      <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/"><img src="/images/ayer-side.svg" alt="丛烨-shimmerjordan"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/">Home</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/archives">Catalogue</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags">Tags</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/%E9%9A%8F%E7%AC%94/">Essay</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/categories">Archives</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/friends">Friends</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/2020/01/18/about">About</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      <a class="nav-item-link nav-item-search"  title="搜索">
        <i class="ri-search-line"></i>
      </a>
      
      
      <a class="nav-item-link" target="_blank" href="/atom.xml" title="RSS Feed">
        <i class="ri-rss-line"></i>
      </a>
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
    </aside>
    <script>
      if (window.matchMedia("(max-width: 768px)").matches) {
        document.querySelector('.content').classList.remove('on');
        document.querySelector('.sidebar').classList.remove('on');
      }
    </script>
    <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>请我喝杯蓝莓汁吧~</p>
  <div class="reward-box">
    
    <div class="reward-item">
      <img class="reward-img" src="/images/alipay.jpg">
      <span class="reward-type">支付宝</span>
    </div>
    
    
    <div class="reward-item">
      <img class="reward-img" src="/images/wechat.jpg">
      <span class="reward-type">微信</span>
    </div>
    
  </div>
</div>
    
<script src="/js/jquery-2.0.3.min.js"></script>


<script src="/js/lazyload.min.js"></script>

<!-- Tocbot -->


<script src="/js/tocbot.min.js"></script>

<script>
  tocbot.init({
    tocSelector: '.tocbot',
    contentSelector: '.article-entry',
    headingSelector: 'h1, h2, h3, h4, h5, h6',
    hasInnerContainers: true,
    scrollSmooth: true,
    scrollContainer: 'main',
    positionFixedSelector: '.tocbot',
    positionFixedClass: 'is-position-fixed',
    fixedSidebarOffset: 'auto'
  });
</script>

<script src="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.css">
<script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js"></script>

<script src="/dist/main.js"></script>

<!-- ImageViewer -->

<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                        <div class="pswp__preloader__cut">
                            <div class="pswp__preloader__donut"></div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div>
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.min.css">
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js"></script>

<script>
    function viewer_init() {
        let pswpElement = document.querySelectorAll('.pswp')[0];
        let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))

        $imgArr.forEach(($em, i) => {
            $em.onclick = () => {
                // slider展开状态
                // todo: 这样不好，后面改成状态
                if (document.querySelector('.left-col.show')) return
                let items = []
                $imgArr.forEach(($em2, i2) => {
                    let img = $em2.getAttribute('data-idx', i2)
                    let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
                    let title = $em2.getAttribute('alt')
                    // 获得原图尺寸
                    const image = new Image()
                    image.src = src
                    items.push({
                        src: src,
                        w: image.width || $em2.width,
                        h: image.height || $em2.height,
                        title: title
                    })
                })
                var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
                    index: parseInt(i)
                });
                gallery.init()
            }
        })
    }
    viewer_init()
</script>

<!-- MathJax -->

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
      tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
      }
  });

  MathJax.Hub.Queue(function() {
      var all = MathJax.Hub.getAllJax(), i;
      for(i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
      }
  });
</script>

<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.6/unpacked/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script>
  var ayerConfig = {
    mathjax: true
  }
</script>

<!-- Katex -->

<!-- busuanzi  -->


<script src="/js/busuanzi-2.3.pure.min.js"></script>


<!-- ClickLove -->


<script src="/js/clickLove.js"></script>


<!-- ClickBoom1 -->

<!-- ClickBoom2 -->

<!-- CodeCopy -->


<link rel="stylesheet" href="/css/clipboard.css">

<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
<script>
  function wait(callback, seconds) {
    var timelag = null;
    timelag = window.setTimeout(callback, seconds);
  }
  !function (e, t, a) {
    var initCopyCode = function(){
      var copyHtml = '';
      copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
      copyHtml += '<i class="ri-file-copy-2-line"></i><span>COPY</span>';
      copyHtml += '</button>';
      $(".highlight .code pre").before(copyHtml);
      $(".article pre code").before(copyHtml);
      var clipboard = new ClipboardJS('.btn-copy', {
        target: function(trigger) {
          return trigger.nextElementSibling;
        }
      });
      clipboard.on('success', function(e) {
        let $btn = $(e.trigger);
        $btn.addClass('copied');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-checkbox-circle-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPIED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-checkbox-circle-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
      clipboard.on('error', function(e) {
        e.clearSelection();
        let $btn = $(e.trigger);
        $btn.addClass('copy-failed');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-time-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPY FAILED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-time-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
    }
    initCopyCode();
  }(window, document);
</script>


<!-- CanvasBackground -->


<script src="/js/dz.js"></script>



    
  </div>
</body>

</html>